package com.kgc.xs.remote;

import com.kgc.basic.util.ResponseMsg;
import com.kgc.xs.pojo.SalesInvoice;
import com.kgc.xs.pojo.SalesOut;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

public interface SalesInvoiceRemote {

    //分页查询发票
    @RequestMapping("/selectSalesInvoiceByPage")
    @ResponseBody
    ResponseMsg selectSalesInvoiceByPage(@RequestBody Map<String, Object> map);

    //新增发票
    @RequestMapping("insertSalesInvoice")
    @ResponseBody
    ResponseMsg insertSalesInvoice(@RequestBody Map<String, Object> map);

    //根据客户（cid）查询对应销售出库单
    @RequestMapping("selectSalesOutByCid")
    @ResponseBody
    ResponseMsg selectSalesOutByCid(@RequestParam("customerId") int customerId);

    //根据销售出库单单据编号查询该单据的明细
    @RequestMapping("selectSalesOutByCode")
    @ResponseBody
    ResponseMsg selectSalesOutByCode(@RequestParam("code") String code);

    //删除发票
    @RequestMapping("/deleteSalesInvoice")
    @ResponseBody
    ResponseMsg deleteSalesInvoice(@RequestParam("id") int id);

    //根据单据编号查询销售发票（回显）
    @RequestMapping("selectSalesInvoiceByCode")
    @ResponseBody
    ResponseMsg selectSalesInvoiceByCode(@RequestParam("code") String code);

    @RequestMapping("/selectSalesInvoiceDetailByCode")
    @ResponseBody
    ResponseMsg selectSalesInvoiceDetailByCode(@RequestParam("invoiceCode") String invoiceCode);

    //在修改前先删除对应的数据
//    @RequestMapping("deleteBeforeUpdate")
//    @ResponseBody
//    ResponseMsg deleteBeforeUpdate(@RequestParam("code") String code);


    //根据单据编号删除主表数据
    @RequestMapping("deleteSalesInvoiceByCode")
    @ResponseBody
    ResponseMsg deleteSalesInvoiceByCode(@RequestParam("code") String code);

    //根据关联的单据编号删除明细表数据
    @RequestMapping("deleteSalesDetailsByCode")
    @ResponseBody
    ResponseMsg deleteSalesDetailsByCode(@RequestParam("code") String code);

    @RequestMapping("insertMainSalesInvoice")
    @ResponseBody
    ResponseMsg insertMainSalesInvoice(@RequestBody SalesInvoice salesInvoice);

    @RequestMapping("getOutStoreList")
    @ResponseBody
    ResponseMsg getOutStoreList(Map<String, Object> map);
}
